<?php
/**
 * Created by PhpStorm.
 * User: sunzexin
 * Date: 2018/2/2
 * Time: 21:57
 */

namespace App\Http\Controllers\Admin;


use App\Http\Logics\Admin\DistrictLogic;
use App\Http\Traits\DistrictTrait;
use App\Http\Controllers\BaseController;
class DistrictController extends BaseController
{
    use DistrictTrait;

    /**
     * 获取辖区列表
     * @return string
     */
    public function getDistrictList()
    {
        $citycode = $this->citycode;
        $data = [
            'citycode' => $citycode
        ];
        $response = DistrictLogic::getDistrictList($data);
        if ($response->code){
            return $this->response($response->code, $response->message);
        }
        return $this->response($response->code, $response->message, $response->data);
    }

    /**
     * 设置辖区的显示状态
     * @return string
     */
    public function setDistrictIsShow()
    {
        $adcode = $this->adcode;
        $data = [
            'adcode' => $adcode
        ];
        $response = DistrictLogic::setDistrictIsShow($data);
        if ($response->code){
            return $this->response($response->code, $response->message);
        }
        return $this->response($response->code, $response->message, $response->data);
    }
}